package com.xxl.job.executor.core.config.rangeland;

/**
 * <h3>xxl-job</h3>
 * <p>数据源配置</p>
 *
 * @author : 来朋
 * @date : 2020-12-28 14:42
 **/
public class DatabaseContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void setDBKey(String dataSourceKey) {
        contextHolder.set(dataSourceKey);
    }

    public static String getDBKey() {
        return contextHolder.get();
    }

    public static void clearDBKey() {
        contextHolder.remove();
    }

}
